package com.xbongbong.pro.sharepermission.pojo.vo;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import lombok.Data;



/**
 * @author 李翔
 * @date 2023/2/28
 * @description
 */
@Data
public class SharePermissionVO {
    private static final long serialVersionUID = 3203649587543044914L;

    /**
     * 主键id
     */
    private Long id;
    /**
     * 规则名称
     */
    private String name;
    /**
     * 共享表单id
     */
    private Long formId;
    /**
     * 共享表单名称
     */
    private String formName;
    /**
     * 授权用户-编辑页回显
     */
    private JSONArray authority;
    /**
     * 授权用户-列表页回显
     */
    private String authorityNameStr;
    /**
     * 数据权限（可编辑 or 只读） - 编辑页
     */
    private Integer permission;
    /**
     * 筛选条件
     */
    private JSONObject condition;
    /**
     * 应用Id
     */
    private Long appId;
    /**
     * 菜单id
     */
    private Long menuId;
    /**
     * 应用类型，1为saas应用，2为自建应用
     */
    private Integer saasMark;
    /**
     * 业务Id
     */
    private Integer businessType;

    public SharePermissionVO() {
    }

    /**
     * 列表页回参
     * @param id
     * @param name
     * @param formId
     * @param formName
     * @param authorityNameStr
     * @param permission
     */
    public SharePermissionVO(Long id, String name, Long formId, String formName, String authorityNameStr, Integer permission) {
        this.id = id;
        this.name = name;
        this.formId = formId;
        this.formName = formName;
        this.authorityNameStr = authorityNameStr;
        this.permission = permission;
    }

    /**
     * 详情页回参
     * @param id
     * @param name
     * @param formId
     * @param formName
     * @param authority
     * @param isPermission
     * @param condition
     * @param appId
     * @param menuId
     * @param saasMark
     * @param businessType
     */
    public SharePermissionVO(Long id, String name, Long formId, String formName, JSONArray authority, Integer permission,
                             JSONObject condition, Long appId, Long menuId, Integer saasMark, Integer businessType) {
        this.id = id;
        this.name = name;
        this.formId = formId;
        this.formName = formName;
        this.authority = authority;
        this.permission = permission;
        this.condition = condition;
        this.appId = appId;
        this.menuId = menuId;
        this.saasMark = saasMark;
        this.businessType = businessType;
    }
}
